import { type Dayjs } from 'dayjs';

export interface SearchInfo {
	photoId?: number;
	name?: string;
	birthDate?: Dayjs | null;
	contactPhone?: string;
	provinceId?: number;
	cityId?: number;
	districtId?: number;
	entryDate?: Dayjs | null;
	expertise?: string;
	positionLevel?: string;
	wechatQrcodeId?: number;
}

export interface pageInfo {
	current?: number;
	pageSize?: number;
	total?: number;
	showTotal: Function;
	showSizeChanger: boolean;
	pageSizeOptions: string[];
	showSizeChange: Function;
	size: string;
	showQuickJumper: boolean;
	defaultPageSize: number;
}

export let pagination = ref<any>({
	// 数据总数
	total: 0,
	// 当前页数
	current: 1,
	// 每页条数
	pageSize: 10,
	// 展示总数
	showTotal: (total: number) => `共 ${total} 条`,
	// 是否可以改变pageSize
	showSizeChanger: true,
	// 设置每页可以展示多少条的选项
	pageSizeOptions: ['10', '20', '50', '100'],
	// 改变pageSize后触发
	showSizeChange: (current: number, pageSize: any) => (
		(pagination.value.current = current),
		(pagination.value.pageSize = pageSize)
	),
	// 小尺寸分页
	size: 'small',
	// 是否可以快速跳转至某页
	showQuickJumper: true,
	//默认条数
	defaultPageSize: 10,
});

export const columns = ref<any>([
	{
		title: '红娘照片',
		dataIndex: 'photoId',
		key: 'photoId',
		width: '90px',
	},
	{
		title: '用户编码',
		dataIndex: 'code',
		key: 'code',
		width: '110px',
	},
	{
		title: '编码',
		dataIndex: 'no',
		key: 'no',
		width: '100px',
	},
	{
		title: '姓名',
		dataIndex: 'name',
		key: 'name',
		width: '120px',
	},
	{
		title: '出生年月日',
		dataIndex: 'birthDate',
		key: 'birthDate',
		width: '140px',
	},
	{
		title: '联系方式',
		dataIndex: 'contactPhone',
		key: 'contactPhone',
		width: '140px',
	},
	{
		title: '地区',
		dataIndex: 'districtName',
		key: 'districtName',
		width: '160px',
	},
	{
		title: '入职日期',
		dataIndex: 'entryDate',
		key: 'entryDate',
		width: '140px',
	},
	{
		title: '擅长领域',
		dataIndex: 'expertise',
		key: 'expertise',
		width: '180px',
	},
	{
		title: '职级',
		dataIndex: 'positionLevel',
		key: 'positionLevel',
		width: '120px',
	},
	{
		title: '状态',
		dataIndex: 'status',
		key: 'status',
		width: '100px',
	},
	{
		title: '单身标识',
		dataIndex: 'singleFlag',
		key: 'singleFlag',
		width: '100px',
	},
	{
		title: '操作',
		key: 'operation',
		fixed: 'right',
		width: '160px',
	},
]);

export interface DataItem {
	photoId: number;
	name: string;
	birthDate: Dayjs;
	contactPhone: string;
	provinceId: number;
	cityId: number;
	districtId: number;
	entryDate: Dayjs;
	expertise: string;
	positionLevel: string;
	wechatQrcodeId: number;
}

export interface ModelInfo {
	title?: string;
	width?: string;
	id?: number | undefined;
	confirmLoading?: boolean;
}

export interface dictInfo {
	typeCode?: string | number | undefined;
	typeName?: string | undefined;
}
